*{margin: 0;padding: 0;box-sizing: border-box;}
*::before{box-sizing: border-box;}
*::after{box-sizing: border-box;}
ul{padding: 0; }
li{list-style: none;}
.clearfix::after{
    content: '';
    display: block;
    clear: both;
}
.bg-btn{
    position: fixed;
    top: 25px;
    left: 25px;
    width: 50px;
    height: 50px;
    background: url('../image/ic_droplet1.png') center center no-repeat;
    background-size: 30px 30px;
    border-radius: 50%;
    box-shadow: 0 1px 2px 0 rgba(32,33,36,0.28);
    cursor: pointer;
    background-color: #fff;
}
.bg-btn.active{
    box-shadow: 0 1px 8px 0 rgba(32,33,36,0.28);
}
.tools{
    position: fixed;
    left: 0;
    bottom: 30px;
    width: 100%;
    height: 50px;
    display: flex;
    justify-content: center;
    text-align: center;
}
.tools .container{
    /* height: 70px; */
    padding: 8px 20px;
    border-radius: 40px;
    box-shadow: 0 1px 2px 0 rgba(32,33,36,0.28);
    background: #fff;
}
.tools button{
    width: 30px;
    height: 30px;
    border: none;
    outline: none;
    background-size: 20px 20px;
    background-position: center center;
    background-repeat: no-repeat;
    background-color: #fff;
    margin: 0 6px;
    transition: 0.3s;
    cursor: pointer;
    border: 2px solid transparent;
}
.tools button.save{
    background-image: url('../image/save.png'); 
}
.tools button.brush{
    background-image: url('../image/pen.png'); 
}
.tools button.eraser{
    background-image: url('../image/eraser.png'); 
}
.tools button.clear{
    background-image: url('../image/clear.png'); 
}
.tools button.undo{
    background-image: url('../image/undo_sel.png'); 
}
.tools button.redo{
    background-image: url('../image/redo_sel.png'); 
}
.tools button.undo.active{
    background-image: url('../image/undo.png');
    border-color: transparent; 
}
.tools button.redo.active{
    background-image: url('../image/redo.png'); 
    border-color: transparent;
}
.tools button.active{
    border-radius: 5px;
    border-color: #1398E6;
}

.color-group{
    display: none;
    position: absolute;
    top: 50px;
    left: 50%;
    margin-left: -161px;
    width: 322px;
    padding: 16px;
    border-radius: 5px;
    box-shadow: 0 1px 4px 0 rgba(32,33,36,0.28);
    background-color: #fff;
}
.color-group .closeBtn,
.pen-detail .closeBtn{
    position: absolute;
    top: 6px;
    right: 8px;
    width: 32px;
    height: 32px;
    background: url('../image/close.png') center center no-repeat;
    cursor: pointer;
}
.color-group.active{
    display: block;
}
.color-group h3{
    font-weight: 500;
    margin-bottom: 8px;
    font-size: 18px;
}
.color-group li{
    position: relative;
    float: left;
    list-style: none;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    margin: 4px;
    cursor: pointer;
}
.color-group li.active::before{
    position: absolute;
    left: 4px;
    top: 4px;
    content: '';
    display: block;
    width: 32px;
    height: 32px;
    background: transparent;
    border: 3px solid #fff;
    border-radius: 50%;
}
.pen-detail{
    display: none;
    position: fixed;
    left: 50%;
    margin-left: -140px;
    bottom: 90px;
    width: 280px;
    height: 210px;
    padding: 20px 24px;
    border: 1px solid #81A4BD;
    border-radius: 5px;
    color: #808FA2;
    font-style: 18px;
    background: #fff;
    font-size: 14px;
}
.pen-detail.active{
    display: block;
}
.pen-detail p{
    margin-top: 2px;
    margin-bottom: 4px;
}
.pen-detail .pen-type li{
    float: left;
    width: 30px;
    height: 30px;
    background-size: 28px 28px;
    background-position: center center;
    background-repeat: no-repeat;
    cursor: pointer;
}
.pen-detail .pen-type li.pen{
    background-image: url('../image/pen_sel.png');
}
.pen-detail .pen-type li.pen.active{
    background-image: url('../image/pen.png');
}
.pen-detail .pen-type li.line{
    background-image: url('../image/line_sel.png');
}
.pen-detail .pen-type li.line.active{
    background-image: url('../image/line.png');
}
.pen-detail .pen-type li.circle{
    border-radius: 50%;
    border: 2px solid #CDCDCD;
}
.pen-detail .pen-type li.circle.active,
.pen-detail .pen-type li.rect.active{
    border-color: #1F1F1F;
}
.pen-detail .pen-type li.rect{
    border-radius: 4px;
    border: 2px solid #CDCDCD;
}
.pen-detail .pen-type li + li{
    margin-left: 28px;
}

.circle-box{
    line-height: 24px;
}

.circle-box{
    position: relative;
    width: 24px;
    height: 24px;
    display: inline-block;
    text-align: center;
    margin-right: 8px;
}
#thickness{
    position: absolute;
    top: 50%;
    left: 50%;
    margin-left: -1px;
    margin-top: -1px;
    background: #000;
    border-radius: 50%;
    transform-origin: center;
    width: 2px;
    height: 2px;
}
input[type=range]{
    -webkit-appearance: none;
    width: 180px;
    height: 24px;
    outline: none;
}
input[type='range']::-webkit-slider-runnable-track{  
    background-color: #DBDBDB;
    height: 4px;
    border-radius: 5px;
}
input[type='range']::-webkit-slider-thumb {  
    -webkit-appearance: none;
    /* border: 5px solid #fff; */
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: #FF4081;
    cursor: pointer;
    margin-top: -4px;
}
.pen-color li{
    position: relative;
    float: left;
    list-style: none;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    margin: 4px;
    cursor: pointer;
}
.pen-color li.active::before{
    position: absolute;
    left: 3px;
    top: 3px;
    content: '';
    display: block;
    width: 24px;
    height: 24px;
    background: transparent;
    border: 2px solid #fff;
    border-radius: 50%;
}
.pen-detail i.showOpacity{
    display: inline-block;
    width: 26px;
    height: 26px;
    background: #000;
    border-radius: 50%;
    margin-right: 4px;
    margin-left: 4px;
}
canvas{
    display: block;
    background: #fff;
}


@media screen and (max-width: 768px) {
    .color-group{
        top: 80px;
    }
    .tools{
        bottom: 15px;
    }
    .pen-detail{
        bottom: 80px;
    }
}